from gui.reference import Pos


class LatticeMap:
    __slots__ = ('name', 'npc_set', 'builds')

    def __init__(self, name: str):
        self.name = name
        self.npc_set = dict()
        self.builds = dict()

    def get_npc(self, pos: Pos):
        return self.npc_set.get(pos.key)

    def get_build(self, pos: Pos):
        return self.builds.get(pos.key)

    def set_npc(self, pos: Pos, obj):
        self.npc_set[pos.key] = obj

    def set_build(self, pos: Pos, obj):
        self.builds[pos.key] = obj
